package com.adwin.addcoin.base

import android.app.Dialog
import android.content.Context
import android.os.Bundle
import android.support.v4.app.INotificationSideChannel
import android.view.View
import android.view.WindowManager

abstract class BaseDialog(mContext:Context):Dialog(mContext) {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(initLayout())
        initData()
        val lp = window!!.attributes
        lp.width = getWidth()
        lp.height = getHeight()
        lp.gravity = getGravity()
        window!!.attributes = lp
        window!!.setBackgroundDrawable(null)
    }

    abstract fun getGravity():Int

    abstract fun getWidth():Int

    abstract fun getHeight():Int

    abstract fun initLayout(): View

    abstract fun initData()
}